package com.hinnotek.amoeba.repo

import com.hinnotek.amoeba.api.ApiService
import com.hinnotek.amoeba.base.BaseBean
import com.hinnotek.amoeba.bean.old.AmibaPayByAmibaPayIdBean
import com.hinnotek.amoeba.bean.old.AmibaProjectListByOrgIdBean
import com.hinnotek.amoeba.bean.old.ProductListBean
import com.lee.common.base.BaseRepository
import com.lee.common.network.net.StateLiveData
import okhttp3.RequestBody
import javax.inject.Inject

class AmibaPayRepo @Inject constructor(private val service: ApiService):BaseRepository() {


    /**
     * app端获取合同列表分页接口
     */
    suspend fun getAmibaPayByAmibaPayId(amibaPayId:Int,stateLiveData: StateLiveData<AmibaPayByAmibaPayIdBean>){
        executeResp({ service.getAmibaPayByAmibaPayId(amibaPayId) }, stateLiveData)
    }

    suspend fun getAmibaPayPageByUserId(applyUserId: Int, pageNo: Int, pageSize: Int, stateLiveData: StateLiveData<MutableList<AmibaProjectListByOrgIdBean>>) {
        executeResp({ service.getAmibaPayPageByUserId(applyUserId,pageNo,pageSize) }, stateLiveData)

    }

    suspend fun getProductList(stateLiveData: StateLiveData<MutableList<ProductListBean>>) {
        executeResp({ service.getProductList() }, stateLiveData)
    }

    suspend fun addAmibaPay(body: RequestBody, baseData: StateLiveData<BaseBean>) {
        executeResp({ service.addAmibaPay(body) }, baseData)
    }


}